﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SelectHospital.aspx.cs"
    Inherits="HZ.Supervise.Web.Common.SelectHospital" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>选择医院</title>
    <link rel="stylesheet" type="text/css" href="../Style/global.css" />

    <script type="text/javascript" src="../Scripts/Common.js"></script>

    <script type="text/javascript" src="../Scripts/global.js"></script>

    <script type="text/javascript" src="../Scripts/jquery.js"></script>

    <script type="text/javascript" src="../Scripts/MainListSelect.js"></script>

    <script type="text/javascript" language="javascript">

        function addHospitalInfo() {
            var HospitalId = document.getElementById("hidAll");
            var HospitalName = document.getElementById("hidAllName");
            var aa = HospitalId.value;
            var bb = HospitalName.value;
            if (aa == null || aa == "") {
                alert("请选择医院");
            }
            window.parent.insertHospitalInfo(aa, bb);
            window.parent.hidePopWin(false);   
//            opener.insertHospitalInfo(aa,bb);
//            window.close();
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <table class ="querylist">
        <tr>
            <td style="width:383px;">
                医院名称：
            </td>
            <td style="width:383px;">
                <asp:TextBox ID="txtHosName" runat="server" Width="183px"></asp:TextBox>
            </td>
            <td style="width:383px; text-align:right;">
                <asp:Button ID="btnselect" runat="server" CssClass="btn" Text="查询" OnClick="btnselect_Click" />
            </td>
        </tr>
    </table>
    <table class="querylist">
        
        <tr>
            <th>
                已选择医院
            </th>
            <th>
                医院列表
            </th>
        </tr>
        <tr>
            <td width="30%">
                <asp:ListBox ID="lbCompany" Width="100%" runat="server" Height="275px" CssClass="mainlist">
                </asp:ListBox>
            </td>
            <td width="70%">
                <asp:GridView ID="gvwHospital" CssClass="mainlist" runat="server" AutoGenerateColumns="False"
                    EmptyDataText="暂无有效的信息！" Width="100%" DataKeyNames="HospitalID" OnRowDataBound="gvwHospital_RowDataBound">
                    <Columns>
                        <asp:TemplateField HeaderText="序号">
                            <ItemTemplate>
                                <%# Container.DataItemIndex + 1 + AspNetPager1.PageSize * (AspNetPager1.CurrentPageIndex - 1)%>
                            </ItemTemplate>
                            <HeaderStyle Width="30px" />
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <%--  <input id="chkAllHospital" name="chkAll" type="checkbox"  title="inputall"  />--%>
                                <%--<asp:CheckBox ID="chkAllCompany" runat="server"   OnCheckedChanged="chkAllCompany_OnCheckedChanged" AutoPostBack="true"/>--%>
                                <asp:Button ID="chkAll" runat="server" OnClick="chkAll_OnClick" CssClass="btn" Text="全选" />
                                <asp:Button ID="UnchkAll" runat="server" OnClick="UnchkAll_OnClick" CssClass="btn"
                                    Text="全不选" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%--<input id="chkHospital" name="chkHospital" type="checkbox"  value='<%# Eval("HospitalID") %>|<%# Eval("HospitalName") %>'  title="input"  onchange="chkHospital_onchange"  onclick="chkHospital_onclick"     />--%>
                                <asp:CheckBox runat="server" ID="chkCompany" OnCheckedChanged="chkCompany_OnCheckedChanged"
                                    AutoPostBack="true" />
                                <asp:HiddenField ID="HidID" runat="server" Value='<%# Eval("HospitalID") %>' />
                                <asp:HiddenField ID="HidName" runat="server" Value='<%# Eval("HospitalName") %>' />
                            </ItemTemplate>
                            <HeaderStyle Width="200px" />
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="医院名称" DataField="HospitalName" />
                    </Columns>
                </asp:GridView>
            </td>
        </tr>
    </table>
    <asp:HiddenField ID="hidAll" runat="server" EnableViewState="true" />
    <asp:HiddenField ID="hidAllName" runat="server" EnableViewState="true" />
    <div class="page">
        <webdiyer:AspNetPager ID="AspNetPager1" runat="server" OnPageChanged="AspNetPager1_OnPageChanged">
        </webdiyer:AspNetPager>
    </div>
    <div class="listctrl" style="text-align: left">
        <input id="btnConfirm" type="button" value="确定选择" onclick="javascript:addHospitalInfo();"
            class="btn" />
        <input id="Button1" type="button" onclick="openner=null;window.close();" value="取消"
            class="btn" />
    </div>
    </form>
</body>
</html>
